"""
Copyright (c) 2023 - present SKbioinfo
"""
from flask_restful import Api
from apps.API.auth.interfaceAuth import interfaceLogin
from apps.API.token.interfaceToken import interfaceRefreshToken
from apps.API.sysSetting.interfaceSettingSystem import interfaceBasicSetting
from apps.API.dashBoard.interfaceDashBoardCharts import interfaceRecentAnaCharts
from apps.API.dashBoard.interfaceDiskMonitor import interfaceDiskMonitor
from apps.API.user.interfaceUser import interfaceUser,interfaceRole,interfaceUserID
from apps.API.user.interfaceUserCenter import interfaceResetUserPasswd
# from apps.API.pipeExecutor.interfaceFormSetting import interfaceBasicFormInfo,interfaceUpdateInfo
from apps.API.pipeExecutor.interfaceFormSetting import interfaceBasicFormInfoByDb
from apps.API.pipeExecutor.interfaceFormQuery import interfaceQuerySampleForm
from apps.API.pipeExecutor.interfacerNGSpipe import interfacePipeRunID,interfaceSubmitAnalysis,interfaceSampleSheet,interfacePipeCheckStatus,interfaceMakeDirectory
from apps.API.pipeExecutor.interfaceGroupEdit import interfaceGroupEdit
from apps.API.pipeMonitor.interfacePipeMonitor import interfaceFecthAnalysisInfo,interfacePipeExecutorLog
from apps.API.pipeMonitor.interfaceQueryMonitor import interfaceQueryMonitor
from apps.API.resultsDisplay.interfacePipeResults import interfacePipeResults
from apps.API.resultsDisplay.interfaceQueryResults import interfaceQueryResults
from apps.API.resultsDisplay.interfaceFetchSamples import interfaceFetchSamplesByID
from apps.API.reportCreator.interfaceReportCreator import interfaceCreateReport
from apps.API.reportCreator.interfaceReportSample import interfaceReportSampleBySheet,interfaceReportSampleSheetByPages
from apps.API.reportCreator.interfaceReportRecord import interfaceReportRecord
from apps.API.pipeResume.interfacepipeResume import interfaceResumeID,interfaceFecthResumeInfo
from apps.API.pipeResume.interfaceQueryResume import interfaceQueryResume
from apps.API.userPermiss.interfaceUserPermiss import interfaceSetPermiss
from apps.API.signature.interfaceSignature import interfaceUploadSignature
from apps.API.customData.interfacecustomData import interfaceAddCustomData
from apps.API.customData.interfaceUpdateDataForm import interfaceUpdateDataForm
def register_api(apps):
    ### INITIAL RESTFUL API ###
    api=Api(apps)
    ### REGISTER: interfaceAuth API ###
    api.add_resource(
        interfaceLogin,
        "/api/auth/Login"
    )
    ### REGISTER: interfaceRecentAna API (DashBordCharts)###
    api.add_resource(
        interfaceRecentAnaCharts,
        "/api/dashBoard/RecentAna"
    ) 
    ### REGISTER:interfaceDiskMonitor API ###
    api.add_resource(
        interfaceDiskMonitor,
        "/api/dashBoard/DiskMonitor",
    )
    ### REGISTER: interfaceUser API ###
    api.add_resource(
        interfaceUser,
        "/api/user/User"
    )
    api.add_resource(
        interfaceUserID, 
        "/api/user/User/<string:id>"
    )
    api.add_resource(
        interfaceRole,
        "/api/user/User/Role"
    )
    api.add_resource(
        interfaceResetUserPasswd,
        "/api/user/UserCenter/ResetUserPasswd"
    )
    ### REGISTER:interfaceUserPermiss API###
    api.add_resource(
        interfaceSetPermiss,
        "/api/userPermiss/SetPermiss",
    )
    ### REGISTER:interfaceUserPermiss API###
    api.add_resource(
        interfaceBasicSetting,
        "/api/sysSetting/BasicSetting"
    )
    ### REGISTER:interfaceFromSetting API ###
    api.add_resource(
        interfaceBasicFormInfoByDb,
        "/api/pipeExecutor/FormSetting/BasicFormInfoByDb/<string:name>"
    )
    api.add_resource(
        interfaceQuerySampleForm,
        "/api/pipeExecutor/FormQuery/QuerySampleForm"
    )
    api.add_resource(
        interfacePipeRunID,
        "/api/pipeExecutor/PipeRunID"
    )
    ### REGISTER:interfacemNGSpipe API ###
    api.add_resource(
        interfaceMakeDirectory,
        "/api/pipeExecutor/makedir/<string:name>"
    )
    api.add_resource(
        interfaceSubmitAnalysis,
        "/api/pipeExecutor/pipeline/analysis/<string:name>"
    )
    api.add_resource(
        interfaceSampleSheet,
        "/api/pipeExecutor/pipeline/samplesheet/<string:name>"
    )
    api.add_resource(
        interfaceGroupEdit,
        "/api/pipeExecutor/GroupEdit/<string:name>"   
    )
    ### REGISTER: interfaceAddCustomData ###
    api.add_resource(
        interfaceAddCustomData,
        "/api/customData/AddCustomData/<string:tag>"
    )
    api.add_resource(
        interfaceUpdateDataForm,
        "/api/customData/UpdateDataForm/<string:tag>"
    )
    ### REGISTER:interfacePipeMonitor API ###
    api.add_resource(
        interfaceQueryMonitor,
        "/api/pipeMonitor/QueryMonitor"
    )
    api.add_resource(
        interfaceFecthAnalysisInfo,
        "/api/pipeMonitor/FecthAnalysisInfo"
    )
    api.add_resource(
        interfacePipeCheckStatus,
        "/api/pipeMonitor/CheckStatus"
    )
    api.add_resource(
        interfacePipeExecutorLog,
        "/api/pipeMonitor/PipeExecutorLog/<string:id>"
    )
   
    ### REGISTER:interfaceReportCreator API ###
    api.add_resource(
        interfaceCreateReport,
        "/api/reportCreator/CreateReport/<string:run_id>"
    )
    api.add_resource(
        interfaceReportSampleBySheet,
        "/api/reportCreator/ReportSample/ReportSampleBySheet"
    )
    api.add_resource(
        interfaceReportSampleSheetByPages,
        "/api/reportCreator/ReportSample/SampleSheetByPages"
    )
    ### REGISTER:interfaceReportRecord API ###
    api.add_resource(
        interfaceReportRecord,
        "/api/reportCreator/ReportRecord/ReportRecord"
    )
    ### REGISTER:interfacepipeResume API ###
    api.add_resource(
        interfaceResumeID,
        "/api/pipeResume/<string:run_id>"
    ) 
    api.add_resource(
        interfaceFecthResumeInfo,
        "/api/pipeResume/ResumeInfo"
    )
    api.add_resource(
        interfaceQueryResume,
        "/api/pipResume/QueryResume"
    )   
    ### REGISTER:interfaceToken API ###
    api.add_resource(
        interfaceRefreshToken,
        "/api/token/refresh"
    )
    ### REGISTER:interfacePipeResults API ###
    api.add_resource(
        interfacePipeResults,
        "/api/resultsDisplay/PipeResults"
    )
    api.add_resource(
        interfaceQueryResults,
        "/api/resultsDislay/QueryResults"
    )
    api.add_resource(
        interfaceFetchSamplesByID,
        "/api/resultsDisplay/FetchSamples/<string:id>"
    )
    ### REGISTER:interfacesignature API ###
    api.add_resource(
        interfaceUploadSignature,
        "/api/signautre/UploadSignatrue/<string:id>"
    )